import Vue from "vue";
import App from "./App.vue";
import router from "./router";
import store from "./store";
import globalSite from "@/config/globalSite";
import Antd from "ant-design-vue";
import "ant-design-vue/dist/antd.less";
import storage from "@/util/storage";
import "@/styles/index.scss";
// import "./mock/index.js"; // 引入mock，模拟请求
import { handleBtn, verifyBtn } from "@/util/permission";
import "@/util/globalComponent";
import validate from "@/util/validate";
import { getEnum, getTime, sameCompany, timeToTimestamp } from "@/util/common";
import { isSuperAdmin } from "@/util/auth";
// 图片预览插件
import Viewer from "v-viewer";
import "viewerjs/dist/viewer.css";
Vue.use(Viewer);
import { isLogin } from "@/util/auth";
import tools from "@/util/tools";

Vue.use(Antd);
Vue.use(validate);

Vue.config.productionTip = false;

// 加载全局配置
Vue.prototype.$globalSite = globalSite;
// 本地缓存
Vue.prototype.$storage = storage;
// 页面按钮权限
Vue.prototype.$btn = handleBtn;
// 没有具体页面的按钮权限
Vue.prototype.$verifyBtn = verifyBtn;
// 查询枚举
Vue.prototype.$getEnum = getEnum;
// 是否登录
Vue.prototype.$isLogin = isLogin;
// 是否超管
Vue.prototype.$isSuperAdmin = isSuperAdmin;
// 是否相同公司
Vue.prototype.$sameCompany = sameCompany;
// 时间戳转换
Vue.prototype.$getTime = getTime;
// 时间转换成时间戳
Vue.prototype.$timeToTimestamp = timeToTimestamp;
// 工具类
Vue.prototype.$tools = tools;

export default new Vue({
  router,
  store,
  render: h => h(App)
}).$mount("#app");
